function initFieldGrid() {
	fieldDataGrid = $('#fieldDataGrid').datagrid({
		url : host + 'moduleAction/getModuleFieldList.html',
		fit : true,
		fitColumns : true,
		border : false,
		pagination : false,
		checkOnSelect : false,
		selectOnCheck : false,
		rownumbers: true,
		singleSelect: true,
		nowrap : true,
		frozenColumns: [],
		columns : [[
			{field : 'tableName', title : '表名', width : 60},
			{field : 'name', title : '标题', width : 60},
			{field : 'fieldName', title : '字段', width : 60},
			{field : 'type', title : '类型', width : 60},
			{field : 'width', title : '宽度', width : 40},
			{field : 'isHide', title : '是否隐藏', width : 40,
				formatter: function(value, row, index) {
					return value == 1 ? "是" : " 否";
				}
			},
			{field : 'isId', title : '主键', width : 30,
				formatter: function(value, row, index) {
					return value == 1 ? "是" : " 否";
				}
			},
			{field : 'isOperation', title : '操作列', width : 40,
				formatter: function(value, row, index) {
					return value == 1 ? "是" : " 否";
				}
			},
			{field : 'orderBy', title : '排序', width : 30},
			{field : 'id', title : '操作', width : 60,
				formatter : function(value, row, index) {
						 return "<a href='javascript: void(0)' onclick='editField(\"" + value + "\", \"" + row.tableName + "\")'>修改</a>&nbsp;"+
								"<a href='javascript: void(0)' onclick='deleteField(\"" + value + "\")'>删除</a>"; 
				}
			}
		]],
		toolbar: [{text: "<span style='font-weight: bold;'>内容</span>"}, "-", {
			id: "fieldAddBtn",
			text : '新增',
			iconCls : 'icon-add',
			disabled: true,
			handler : function() {
				batchImportField();
			}
		}]
	});
}
function editField(id, tableName) {
	dialog = baseJs.window(host + "system/setting/module/editField.html?id=" + id + 
		"&tableName=" + tableName + "&pageType=" + selectedRow.type, {
		title: "编辑页面信息", width: 780, height: 440
	});
}
function deleteField(id) {
	baseJs.confirm("确定提示", "确定删除此内容？", function(r) {
		if (r) {
			$.post(host + "moduleAction/deleteField.html", {"id": id}, function(data) {
				if (data.status == "ok") {
					fieldDataGrid.datagrid('reload');
				}
				alert(data.msg);
			}, "json");
		}
	});
}
function batchImportField() {
	dialog = baseJs.window(host + "system/setting/module/importField.html?type=field&moduleId=" + selectedRow.id, {
		title: "导入页面信息", width: 600, height: 510
	});
}